# 从精降日志筛选出识别结果
import re

f_orig = open('precise-landing.INFO') # original file
f_coord = open('detect.log', 'w')  # target file used to save

data = f_orig.read()

pattern = re.compile(r'I([\S]*[0-9].[\S]*)..([0-9]*.detect_algorithm.cpp:(236|189).*?theta..[\S]*\n)', re.S)
it = pattern.finditer(data)
for match in it: 
    f_coord.write(match.group())

f_orig.close()
f_coord.close()